<?php

namespace app\common;

class OsTypeClass
{
    use InstanceTrait;

    const OS_TYPE_ANDROID = 1;
    const OS_TYPE_IOS = 2;
    const OS_TYPE_WEB = 3;
    const OS_TYPE_H5 = 4;
    const OS_TYPE_MICRO_APP = 5;

    public function getName(int $type): string
    {
        return match ($type) {
            self::OS_TYPE_ANDROID => '安卓',
            self::OS_TYPE_IOS => 'IOS',
            self::OS_TYPE_WEB => 'WEB',
            self::OS_TYPE_H5 => 'H5',
            self::OS_TYPE_MICRO_APP => '小程序',
            default => '',
        };
    }

}